﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NPMonitor.Web.UserControls
{
    public partial class ReportTimePicker : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
//            string regExpress = @"^(((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))
//                                    |(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))
//                                    |(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))
//                                    |(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])
//                                    |((16|[2468][048]|[3579][26])00))-0?2-29-)) (20|21|22|23|[0-1]?\d):[0-5]?\d)$ ";
            string regExpress = @"^\d{2}-\d{2}-\d{4}(\s(20|21|22|23|[0-1]?\d):[0-5]?\d)?$";
            //regvStartTime.ValidationExpression = regExpress;
            //regvEndTime.ValidationExpression = regExpress;

            //regvStartTime.ErrorMessage = ValidationString.StartTimeInvalidate;
            //regvEndTime.ErrorMessage = ValidationString.EndTimeInvalidate;
            //cvTime.ErrorMessage = ValidationString.EndTimeGreaterThenStartTime;
        }

        public string BeginDate 
        {
            get
            {
                return this.txtTime.Text;
            }
            set
            {
                this.txtTime.Text = value;
            }
        }

        public string EndDate
        {
            get
            {
                return this.txtEndtime.Text;
            }
            set
            {
                this.txtEndtime.Text = value;
            }
        }

        public string ReportType
        {
            get
            {
                return this.hfdReportType.Value;
            }
            set
            {
                this.hfdReportType.Value = value;
            }
        }
    }
}